package chapter8;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter(filterName = "adminFilter",urlPatterns = "/*")


public class adminFilter implements Filter {
    public void destroy() {
        /**
         * 过滤方法
         */
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        System.out.println("进入到了过滤器");
        chain.doFilter(req, resp);//放行
        System.out.println("过滤器实现了放行");
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
